﻿using System;
using System.Activities;
using System.Diagnostics;

namespace MyTest {
    /// <summary>
    /// Book2 的摘要说明
    /// </summary>
    public class Book2 : Product
    {
        private string isbn;    //书号
        private string intro;   //简介

        public string Isbn {
            get { return isbn; }
            set {
                if (value.Length != 13) {
                    throw new ArgumentException("请输入13位的ISBN");
                }
                isbn = value;
            }
        }

        public string Intro {
            get { return intro; }
            set { intro = value; }
        }

        public Book2():base("默认书籍名")
        {
            Debug.WriteLine("-==调用Book2的无参构造方法");
        }

        public override string ShowDetail()
        {
            return "ISBN:" + this.isbn + ",简介：" + this.intro;
        }

        public override string Show()
        {
            return base.Show();
            //return "书籍名称：" + this.name + "书籍价格:" + this.price;
        }

        ~Book2() {
            Debug.WriteLine("-==调用析构函数==-");
        }
    }
}